import http from "@/utils/http.js";


/**
 * 条件获取属性key
 * @returns
 */
export function getAttrKeyAPI(params) {
    return http.post(`/attrKey/getByConditions`,params);
}

/**
 * 添加属性名
 * @param {object} params AttrKeyAddRequest
 * @param {string} params.categoryId
 * @param {string} params.keyName
 * @param {number} params.attrType
 * @returns
 */
export function addAttrKeyAPI(params) {
    return http.post(`/attrKey/add`, params);
}

/**
 * 删除属性名
 * @param {string} id
 * @returns
 */
export function deleteAttrKeyAPI(id) {
    return http.delete(`/attrKey/${id}`);
}

/**
 * 修改属性名
 * @param {object} params AttrKey
 * @param {number} params.id
 * @param {number} params.categoryId
 * @param {string} params.keyName
 * @returns
 */
export function updateAttrKeyAPI(params) {
    return http.put(`/attrKey/update`, params);
}